package edu.tju.moralManage;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.younker.waf.db.IBatisConfig;

import edu.tju.classes.AdvisorHistory;

public class IbatisRpTypeDao implements IRpTypeDao{
	protected SqlMapClient sqlMap = IBatisConfig.getSqlMapInstance();
	
	public void deleteRpType(long id) throws SQLException {
		sqlMap.delete("deleteRpType", id);
		
	}

	@SuppressWarnings("unchecked")
	public List<RpType> getRpTypeAnd(RpType rpType) throws SQLException {
		return sqlMap.queryForList("getRpTypeAnd", rpType);
	}

	public RpType getRpTypeById(long id) throws SQLException {
		return (RpType) sqlMap.queryForObject("getRpTypeById", id);
	}

	public Long insertRpType(RpType rpType) throws SQLException {
		return (Long)sqlMap.insert("insertRpType", rpType);
	}

}
